<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

// Route::middleware('auth:api')->get('/user', function (Request $request) {
//     return $request->user();
// });

# 登录路由
Route::namespace('Api')->group(function () {
    Route::post('login', 'LoginController@login');
}); 

Route::namespace('Api')->middleware(['auth:api','token'])->group(function(){
	Route::get('/menu', 'MenuController@index');
	Route::get('/member_ip', 'MemberController@select_ip');
	Route::get('/member_machine', 'MemberController@select_machine');
	Route::get('/menu/category/{category_id}', 'MenuController@category');
	Route::post('/suggest', 'SuggestController@add')->middleware('suggest');
	Route::post('/add_image', 'SuggestController@add_image')->middleware('suggest');
	Route::post('/article/{category_id}', 'ArticleController@index');
	Route::post('/article_info/{article_id}', 'ArticleController@info');
	Route::post('/check_token', 'CheckTokenController@check_token');
	Route::get('/banner', 'BannerController@lists');
	Route::post('/update_password', 'MemberController@update_password');

	Route::get('/map', 'MapController@index');
	Route::get('/world_map', 'WorldMapController@index');
});
